package com.gljx.web.service.impl;

import com.gljx.web.Entity.Goodstable;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.GoodstableMapper;
import com.gljx.web.service.GoodstableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 物品业务逻辑实现类
 *
 * @Author: WuLianFa
 * @CreationTime: 2018/5/22 0022 上午 10:42
 */
@Service
@Transactional
public class GoodstableServiceImpl extends CommonDao implements GoodstableService {
    //注入mapper
    @Autowired
    private GoodstableMapper goodstableMapper;

    /**
     * 分页显示全部物品信息
     * Created by WuLianFa on 2018/5/22 0022 上午 10:55
     */
    public List<Goodstable> goodsAllMassageList(String wpName, String wpType, String wpGgid, String wpSchoolid) {
        return goodstableMapper.goodsAllMassageList(wpName, wpType, wpGgid, wpSchoolid);
    }

    /**
     * 增加物品信息
     * Created by WuLianFa on 2018/5/22 0022 下午 3:42
     */
    public int insertSelective(Goodstable goodstable) {
        return goodstableMapper.insertSelective(goodstable);
    }

    /**
     * 通过ID删除物品信息
     * Created by WuLianFa on 2018/5/22 0022 下午 3:44
     */
    public int deleteByPrimaryKey(String wpId) {
        return goodstableMapper.deleteByPrimaryKey(wpId);
    }

    /**
     * 通过ID查询物品信息
     * Created by WuLianFa on 2018/5/22 0022 下午 3:45
     */
    public Goodstable selectByPrimaryKey(String wpId) {
        return goodstableMapper.selectByPrimaryKey(wpId);
    }

    /**
     * 通过实体类修改物品信息
     * Created by WuLianFa on 2018/5/22 0022 下午 3:53
     */
    public int updateByPrimaryKeySelective(Goodstable goodstable) {
        return goodstableMapper.updateByPrimaryKeySelective(goodstable);
    }

    @Override
    public List<Goodstable> selectGoodsAll(String companyId) {

        return goodstableMapper.selectGoodsAll(companyId);
    }

    @Override
    public List<Goodstable> selectInOutnum(String companyId) {


        return goodstableMapper.selectInOutnum(companyId);
    }
}
